#if (FEATURE_MODE == 0)

/**
 @file ctc_tmx_sc_oam.c

 @date 2019-4-12

 @version v6.0

*/

/****************************************************************************
 *
* Header Files
*
****************************************************************************/
#include "sal.h"
#include "ctc_sc_oam.h"
#include "ctc_error.h"
#include "sys_usw_common.h"
#include "sys_usw_sc_oam.h"


/****************************************************************************
 *
* Defines and Macros
*
*****************************************************************************/

/****************************************************************************
 *
* Global and Declaration
*
*****************************************************************************/

/****************************************************************************
 *
* Function
*
*****************************************************************************/

int32
ctc_tmx_sc_oam_add_mep(uint8 lchip, ctc_sc_oam_mep_t* p_mep)
{
    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_PTR_VALID_CHECK(p_mep);
    CTC_ERROR_RETURN(sys_usw_sc_oam_add_mep(lchip, p_mep));
    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_remove_mep(uint8 lchip, ctc_sc_oam_mep_t* p_mep)
{
    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_PTR_VALID_CHECK(p_mep);
    CTC_ERROR_RETURN(sys_usw_sc_oam_remove_mep(lchip, p_mep));
    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_update_mep(uint8 lchip, ctc_sc_oam_mep_t* p_mep)
{
    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_PTR_VALID_CHECK(p_mep);
    CTC_ERROR_RETURN(sys_usw_sc_oam_update_mep(lchip, p_mep));
    return CTC_E_NONE;
}


int32
ctc_tmx_sc_oam_get_mep(uint8 lchip, ctc_sc_oam_mep_t* p_mep)
{
    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_PTR_VALID_CHECK(p_mep);
    CTC_ERROR_RETURN(sys_usw_sc_oam_get_mep(lchip, p_mep));
    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_set_mep_property(uint8 lchip, ctc_sc_oam_mep_prop_t* p_mep_prop)
{
    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_PTR_VALID_CHECK(p_mep_prop);
    CTC_ERROR_RETURN(sys_usw_sc_oam_set_mep_property(lchip, p_mep_prop));
    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_get_mep_property(uint8 lchip, ctc_sc_oam_mep_prop_t* p_mep_prop)
{
    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_PTR_VALID_CHECK(p_mep_prop);
    CTC_ERROR_RETURN(sys_usw_sc_oam_get_mep_property(lchip, p_mep_prop));
    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_get_mep_info(uint8 lchip, ctc_sc_oam_mep_info_t* p_mep_info)
{
    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_PTR_VALID_CHECK(p_mep_info);
    CTC_ERROR_RETURN(sys_usw_sc_oam_get_mep_info(lchip, p_mep_info));
    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_set_property(uint8 lchip, ctc_sc_oam_prop_t* p_prop)
{

    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_ERROR_RETURN(sys_usw_sc_oam_set_property(lchip, p_prop));

    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_get_property(uint8 lchip, ctc_sc_oam_prop_t* p_prop)
{

    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);

    CTC_ERROR_RETURN(sys_usw_sc_oam_get_property(lchip, p_prop));

    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_init(uint8 lchip, void* p_cfg)
{
    uint8 lchip_start              = 0;
    uint8 lchip_end                = 0;

    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_FOREACH_LCHIP(lchip_start, lchip_end, 1)
    {
        CTC_ERROR_RETURN(sys_usw_sc_oam_init(lchip, p_cfg));
    }

    return CTC_E_NONE;
}

int32
ctc_tmx_sc_oam_deinit(uint8 lchip)
{
    uint8 lchip_start              = 0;
    uint8 lchip_end                = 0;

    FEATURE_SUPPORT_CHECK(CTC_FEATURE_SC_OAM);
    LCHIP_CHECK(lchip);
    CTC_FOREACH_LCHIP(lchip_start, lchip_end, 1)
    {
        CTC_ERROR_RETURN(sys_usw_sc_oam_deinit(lchip));
    }

    return CTC_E_NONE;
}

#endif

